<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sec="http://www.springframework.org/security/facelets/tags">

<h:head>
	<title>SiGlog</title>
	<link rel="shortcut icon" href="imagens/favicon.ico"
		type="image/x-icon" />
	<link type="text/css" rel="stylesheet" href="css/stylesheet.css" />
</h:head>

<h:body>
	<center>
		<form id="login" method="post"
			action="#{request.contextPath}/j_spring_security_check">

			<p:panel header="Login" style="width:40%; margin-top:5%;">
				<p:graphicImage url="imagens/siglog.jpg" />
				<br />
				<br />
				<h:panelGrid columns="1" cellpadding="5">

					<input id="matr" type="text" name="j_username" required="required"
						placeholder="Matrícula" />

					<input id="senha" type="password" name="j_password"
						required="required" placeholder="Senha" />

					<h:panelGrid columns="2" cellpadding="5">
						<input id="entrarAuto" type="checkbox"
							name="_spring_security_remember_me" />
						Manter-me conectado
					</h:panelGrid>
				</h:panelGrid>
				<input type="submit" value="Entrar" />
				<br />
				<h:panelGroup rendered="#{!empty param.login_error}">
					<span style="color: red;">Erro ao efetuar o login. Matrícula
						e/ou senha incorreta.</span>
				</h:panelGroup>
				<br />
				<br />
				<h:graphicImage url="imagens/logopcr1.png" />
			</p:panel>

			<script>
			document.getElementById("login").j_username.value = "#{SPRING_SECURITY_LAST_USERNAME}";
			</script>

		</form>
	</center>
</h:body>
</html>